<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String loginSuccess = (String) session.getAttribute("loginSuccess");
    if (loginSuccess != null) {
        session.removeAttribute("loginSuccess");
    }
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理中心 - 应急防护小站</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-gray-50 min-h-screen text-gray-900">
    <% if (loginSuccess != null) { %>
    <div id="loginSuccessToast" class="fixed top-6 left-1/2 transform -translate-x-1/2 z-50 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg flex items-center space-x-2 animate-bounce-in">
        <i class="fa-solid fa-circle-check text-xl"></i>
        <span><%= loginSuccess %></span>
    </div>
    <script>
        setTimeout(function() {
            var toast = document.getElementById('loginSuccessToast');
            if (toast) toast.style.display = 'none';
        }, 3000);
    </script>
    <% } %>
    <!-- 顶部导航栏 -->
    <nav class="bg-white shadow-sm sticky top-0 z-40">
        <div class="max-w-7xl mx-auto flex items-center justify-between px-4 h-16">
            <div class="flex items-center space-x-2">
                <i class="fa-solid fa-shield-alt text-red-600 text-2xl"></i>
                <span class="text-xl font-bold">应急防护小站</span>
                <span class="text-sm text-gray-500 ml-2">管理中心</span>
            </div>
            <div class="flex items-center space-x-4">
                <a href="index.jsp" class="text-gray-600 hover:text-red-600 flex items-center">
                    <i class="fa-solid fa-home mr-1"></i>返回首页
                </a>
                <a href="logout" class="text-gray-600 hover:text-red-600 flex items-center">
                    <i class="fa-solid fa-sign-out-alt mr-1"></i>退出登录
                </a>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <main class="max-w-7xl mx-auto px-4 py-8">
        <!-- 欢迎区域 -->
        <div class="bg-gradient-to-r from-red-600 to-red-700 rounded-2xl p-8 mb-8 text-white">
            <h1 class="text-3xl font-bold mb-2">欢迎来到管理中心</h1>
            <p class="text-red-100">管理应急防护小站的所有功能和内容</p>
        </div>

        <!-- 统计卡片 -->
        <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
            <div class="bg-white rounded-xl shadow p-6 border-l-4 border-blue-500">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-500 text-sm">总用户数</p>
                        <p class="text-2xl font-bold text-gray-900">1,234</p>
                    </div>
                    <i class="fa-solid fa-users text-blue-500 text-2xl"></i>
                </div>
            </div>
            <div class="bg-white rounded-xl shadow p-6 border-l-4 border-green-500">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-500 text-sm">待审核投稿</p>
                        <p class="text-2xl font-bold text-gray-900">56</p>
                    </div>
                    <i class="fa-solid fa-file-text text-green-500 text-2xl"></i>
                </div>
            </div>
            <div class="bg-white rounded-xl shadow p-6 border-l-4 border-yellow-500">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-500 text-sm">待处理反馈</p>
                        <p class="text-2xl font-bold text-gray-900">23</p>
                    </div>
                    <i class="fa-solid fa-comment-dots text-yellow-500 text-2xl"></i>
                </div>
            </div>
            <div class="bg-white rounded-xl shadow p-6 border-l-4 border-purple-500">
                <div class="flex items-center justify-between">
                    <div>
                        <p class="text-gray-500 text-sm">今日订单</p>
                        <p class="text-2xl font-bold text-gray-900">12</p>
                    </div>
                    <i class="fa-solid fa-shopping-bag text-purple-500 text-2xl"></i>
                </div>
            </div>
        </div>

        <!-- 功能卡片 -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
            <a href="admin-user" class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group">
                <div class="text-center">
                    <div class="bg-blue-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4 group-hover:bg-blue-200 transition-colors">
                        <i class="fa-solid fa-users text-blue-600 text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-bold text-gray-900 mb-2">用户管理</h3>
                    <p class="text-gray-600 text-sm">审核、编辑、禁用、删除用户账户</p>
                </div>
            </a>
            
            <a href="admin-article" class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group">
                <div class="text-center">
                    <div class="bg-green-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4 group-hover:bg-green-200 transition-colors">
                        <i class="fa-solid fa-file-text text-green-600 text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-bold text-gray-900 mb-2">投稿管理</h3>
                    <p class="text-gray-600 text-sm">审核、编辑、发布用户投稿内容</p>
                </div>
            </a>
            
            <a href="admin-feedback" class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group">
                <div class="text-center">
                    <div class="bg-yellow-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4 group-hover:bg-yellow-200 transition-colors">
                        <i class="fa-solid fa-comment-dots text-yellow-600 text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-bold text-gray-900 mb-2">反馈管理</h3>
                    <p class="text-gray-600 text-sm">处理、回复、标记用户反馈信息</p>
                </div>
            </a>
            
            <a href="admin-order" class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group">
                <div class="text-center">
                    <div class="bg-purple-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4 group-hover:bg-purple-200 transition-colors">
                        <i class="fa-solid fa-shopping-bag text-purple-600 text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-bold text-gray-900 mb-2">订单管理</h3>
                    <p class="text-gray-600 text-sm">查看、发货、取消图书订单</p>
                </div>
            </a>
            
            <a href="admin-book" class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group">
                <div class="text-center">
                    <div class="bg-indigo-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4 group-hover:bg-indigo-200 transition-colors">
                        <i class="fa-solid fa-book text-indigo-600 text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-bold text-gray-900 mb-2">图书管理</h3>
                    <p class="text-gray-600 text-sm">管理科普书籍的售卖内容</p>
                </div>
            </a>
        </div>

        <!-- 快速操作 -->
        <div class="mt-8 bg-white rounded-xl shadow p-6">
            <h3 class="text-lg font-bold mb-4 flex items-center">
                <i class="fa-solid fa-bolt text-red-600 mr-2"></i>快速操作
            </h3>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <a href="announcement?action=list" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg flex items-center justify-center transition-colors">
                    <i class="fa-solid fa-plus mr-2"></i>发布公告
                </a>
                <div class="relative group">
                    <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center justify-center transition-colors w-full">
                        <i class="fa-solid fa-download mr-2"></i>导出数据
                    </button>
                    <div class="absolute top-full left-0 mt-1 bg-white shadow-lg rounded-lg py-2 z-50 hidden group-hover:block min-w-48">
                        <a href="export?type=users" class="block px-4 py-2 text-gray-700 hover:bg-gray-100">导出用户数据</a>
                        <a href="export?type=orders" class="block px-4 py-2 text-gray-700 hover:bg-gray-100">导出订单数据</a>
                        <a href="export?type=feedback" class="block px-4 py-2 text-gray-700 hover:bg-gray-100">导出反馈数据</a>
                        <a href="export?type=books" class="block px-4 py-2 text-gray-700 hover:bg-gray-100">导出图书数据</a>
                    </div>
                </div>
                <a href="system-setting" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center justify-center transition-colors">
                    <i class="fa-solid fa-cog mr-2"></i>系统设置
                </a>
            </div>
        </div>
    </main>

    <!-- 底部信息 -->
    <footer class="bg-gray-900 text-white py-8 mt-16">
        <div class="max-w-7xl mx-auto px-4 text-center">
            <div class="flex items-center justify-center space-x-2 mb-4">
                <i class="fa-solid fa-shield-alt text-red-400 text-xl"></i>
                <span class="text-lg font-bold">应急防护小站管理中心</span>
            </div>
            <p class="text-gray-400 text-sm">&copy; 2025 应急防护小站. 保留所有权利.</p>
        </div>
    </footer>
</body>
</html> 